#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<unistd.h>
int main()
{
  char buffer[1024];
 int fd2 =  open("file1.c", O_CREAT | O_WRONLY | O_TRUNC, 0644);
 int fd1 =  open("file2.c",O_RDONLY);
 read(fd2,buffer,1024);
 write(fd1,buffer,1024);
 close(fd1);
 close(fd2);
}
